package util

import (
	"fmt"
	"net"
	"time"
)

func DialPortTimeout(server string, port int) bool {
	if conn, err := net.DialTimeout("tcp", fmt.Sprintf("%s:%d", server, port), time.Second); err == nil {
		defer conn.Close()
		return true
	}
	return false
}